<#include "/macro.include"/>
<#include "/java_copyright.include">
<#assign className = table.className>   
<#assign classNameLower = className?uncap_first> 
package ${basepackage}.app.vo.query;


import java.io.Serializable;


import org.springframework.format.annotation.DateTimeFormat;
import ${basepackage}.framework.base.util.DateUtil;
import ${basepackage}.framework.base.ColumnQuery;
import ${basepackage}.framework.base.page.BaseQuery;


public class ${className}Query extends BaseQuery implements Serializable {
    private static final long serialVersionUID = 3148176768559230877L;
    
	<@generateFields/>
	<@generateProperties/>

	
}

<#macro generateFields>

	<#list table.columns as column>
	<#if column.isEditable>
	/** ${column.columnAlias} */
	<#if column.isDateColumn>
	@DateTimeFormat(pattern="dd/MM/yyyy")
	private ${column.javaType} ${column.columnNameLower}Begin;
	@DateTimeFormat(pattern="dd/MM/yyyy")
	private ${column.javaType} ${column.columnNameLower}End;
	<#elseif column.isTimestampColumn>
	@DateTimeFormat(pattern="dd/MM/yyyy")
	private java.util.Date ${column.columnNameLower}Begin;
	@DateTimeFormat(pattern="dd/MM/yyyy")
	private java.util.Date ${column.columnNameLower}End;
	<#else>
	private ${column.javaType} ${column.columnNameLower};
	</#if>
	</#if>
	</#list>

</#macro>

<#macro generateProperties>
	<#list table.columns as column>
	<#if column.isEditable>
	
	<#if column.isDateTimeColumn>
	@ColumnQuery(name="${column.columnNameLower}",operator=">=")
	public java.util.Date get${column.columnName}Begin() {
		return this.${column.columnNameLower}Begin;
	}
	
	public void set${column.columnName}Begin(java.util.Date value) {
		this.${column.columnNameLower}Begin = value;
	}	
	
	@ColumnQuery(name="${column.columnNameLower}",operator="<=")
	public java.util.Date get${column.columnName}End() {
		return DateUtil.getEndOfTheDay(this.${column.columnNameLower}End);
	}
	
	public void set${column.columnName}End(java.util.Date value) {
		this.${column.columnNameLower}End = value;
	}
	
	<#else>
	<#if column.isForeignKey>
	@ColumnQuery(name="${column.referenceTableLower}.id")
	<#else>
	@ColumnQuery
	</#if>
	public ${column.javaType} get${column.columnName}() {
		return this.${column.columnNameLower};
	}
	
	public void set${column.columnName}(${column.javaType} value) {
		this.${column.columnNameLower} = value;
	}
	
	
	</#if>	
	</#if>
	</#list>
</#macro>



